package com.lion.seaman.common.model;

/**
 * Created by liyongyao on 2017/1/21.
 */
public class Message {
    private String msg;
    private Integer code;
    private Object result;

    public Message(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Message(Integer code, String msg, Object result) {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }

    public static Message success(String msg) {
        return new Message(1, msg);
    }

    public static Message success(String msg, Object result) {
        return new Message(1, msg, result);
    }

    public static Message fail(String msg) {
        return new Message(0, msg);
    }

    public static Message fail(String msg, Object result) {
        return new Message(0, msg, result);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }


}
